import axios from '@/axios';

export default {
  getProductList (pid) {
    return axios.get('/api/product/getProducts?pid=' + pid);
  },
  getProductDetail (prod_key) {
    return axios.get('/api/product/getProductDetail?prod_key=' + prod_key);
  },
  getPropertyList (prod_key) {
    return axios.get('/api/params/list?prod_key=' + prod_key);
  },
  getCmdList (prod_key) {
    return axios.get('/api/params/cmdList?prod_key=' + prod_key);
  },
  editParam (param) {
    return axios.post('/api/params/paramOperation', param);
  },
  deleteParam (param) {
    return axios.post('/api/params/paramDel', param);
  },
  editCmd (cmd) {
    return axios.post('/api/params/cmdOperation', cmd);
  },
  deleteCmd (cmd) {
    return axios.post('/api/params/cmdDel', cmd);
  },
  updateDeviceList(prodKey){
    return axios.get('/api/update/devices?prod_key='+prodKey);
  },
  getDevicesRend(prodKey, start_time, end_time) {
    return axios.get('/api/product/devicesTrend?prodKey='+ prodKey + '&start_time=' + start_time + '&end_time=' + end_time);
  },
  updateProductSetting(product){
    return axios.post('/api/product/update/setting', product);
  },
  getPushRuleList (prod_key) {
    return axios.get('/api/product/pushRules?prod_key=' + prod_key);
  },
}
